#ifndef VIEWINGPARAMETERSSTATE
#define VIEWINGPARAMETERSSTATE

#include <base\vec2i.h>
#include <app\states\sessionState.h>
#include <app\states\modelInfoState.h>
#include <network\streamingClient.h>
#include <render\viewFrustum.h>
#include <render\observers\viewChangeObserver.h>

#include <boost/signal.hpp>
#include <boost/bind.hpp>

#include <string>
#include <sstream>
#include <iostream>

using namespace std;

struct s_view_parameters {
  vec2i window_size;
  vec2i tiled_window_size;
  vec2i level_interval;
  viewFrustum frustum;

  s_view_parameters() : 
    window_size(0, 0), 
    tiled_window_size(0, 0), 
    level_interval(0, 0) {
    };
};

class viewingParametersState : public sessionState {

  static int class_type_id;
  int type_id;

  boost::signal1<void, const viewingParametersState *> viewChange_sig;
  bool changed; ///< indicate the viewing parameters has changed

public:

  void copy(const viewingParametersState *vp_state);

  void addViewChangeObserver(viewChangeObserver *ref);

  s_view_parameters info; ///< public parameters

  static sessionState *create();

  void setWindowSize(int width, int height);
  void setLevelsInterval(int from, int to);

  static int getClassTypeId();
  virtual int getTypeId();

  viewingParametersState();
  virtual ~viewingParametersState();
};

#endif